<?php

namespace Kollway\CodeGenerator\Commands;

use Kollway\CodeGenerator\Generators\ModelGenerator;

class CreateModelCommand extends BaseCommand
{
    public $signature = "cm {--table=}";

    public $description = "生成model文件";

    /** @throws \Throwable */
    public function handle()
    {
        $table = $this->option('table');

        $model_generator = new ModelGenerator($table, []);
        $model_generator->generateModelString();
        $model_generator->writeToFile();
    }
}